<?php

/*
Edit Enemy (admin_edit_enemy.php)
*/

$page_title = "Edit Enemy";
$rank_check = 7;
include "../header.inc.php";

print "$openHTML";

if (!$act)
{
	$findEnemies = mysql_query("SELECT * FROM one_players2 WHERE game = '$game'");
	while ($getEnemies = mysql_fetch_array($findEnemies))
	{	
		$enemyList .= "<option value=$getEnemies[id]>$getEnemies[name]</option>";
	}
	
ECHO <<<END

<FORM ACTION="admin_edit_enemy.php?game=$game&act=edit" METHOD=POST> <CENTER><TABLE BGCOLOR="$tableOutline"
CELLSPACING=1 CELLPADDING=0 WIDTH=520> <TR BGCOLOR="$topAndBottomBG"> <TD COLSPAN=2 HEIGHT=50>
<CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--Edit Enemy--</FONT></CENTER> </TD> </TR>
<TR BGCOLOR="$maincellColor"> <TD WIDTH=128 HEIGHT=40> <P>Edit Enemy</P> </TD> <TD
HEIGHT=40> <P><FONT SIZE="-1">&nbsp;<select name=edit_enemy>$enemyList</select></FONT></P> </TD> </TR> <TR> <TD
COLSPAN=2 HEIGHT=30 BGCOLOR="$topAndBottomBG"> <CENTER><FONT SIZE="-1" COLOR="$topAndBottomText"><I><INPUT
TYPE=submit NAME=Submit VALUE="Edit Enemy!!"></I></FONT></CENTER> </TD> </TR>
</TABLE> </CENTER> </FORM>

END;

}

if ($act == "edit")
{

$findEnemy = fetch("SELECT * FROM one_players2 WHERE game = '$game' AND id = '$edit_enemy'");

ECHO <<<END

<P><FORM ACTION="admin_edit_enemy.pro.php?game=$game&edit=$edit_enemy" enctype="multipart/form-data" METHOD=POST>
   <CENTER><TABLE BGCOLOR="$tableOutline" CELLSPACING=1 CELLPADDING=0 WIDTH=400>
      <TR BGCOLOR="$topAndBottomBG">
         <TD COLSPAN=2 HEIGHT=50>
            <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--Edit Enemy--</FONT></CENTER>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=128 HEIGHT=40>
            <P>Enemy Name</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text NAME="add_pet_name" VALUE="$findEnemy[name]" SIZE=30 MAXLENGTH=16></FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG">
         <TD WIDTH=128 HEIGHT=40>
            <P>Enemy Image</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">&nbsp;<input type=file name=petImage><br>(only use if your changing the image!)</FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=128 HEIGHT=40>
            <P>Stats:</P>
         </TD>
         <TD HEIGHT=40>
            <P><FONT SIZE="-1">
            &nbsp;Level: <INPUT TYPE=text NAME="add_level" VALUE="$findEnemy[level]" SIZE=4 MAXLENGTH=16><br>
            &nbsp;Strength: <INPUT TYPE=text NAME="add_strength" VALUE="$findEnemy[strength]" SIZE=4 MAXLENGTH=16><br>
			&nbsp;Defense: <INPUT TYPE=text NAME="add_defense" VALUE="$findEnemy[defense]" SIZE=4 MAXLENGTH=16><br>
			&nbsp;Speed: <INPUT TYPE=text NAME="add_speed" VALUE="$findEnemy[speed]" SIZE=4 MAXLENGTH=16><br>
			&nbsp;Health Points: <INPUT TYPE=text NAME="add_health" VALUE="$findEnemy[health]" SIZE=4 MAXLENGTH=16>
			</FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$middleBG">
         <TD WIDTH=128 HEIGHT=40>
            <P># To Kill:</P>
         </TD>
         <TD HEIGHT=40>
            <P><INPUT TYPE=text NAME="to_kill" VALUE="$findEnemy[guys_left]" SIZE=4 MAXLENGTH=16></FONT></P>
         </TD>
      </TR>
      <TR BGCOLOR="$maincellColor">
         <TD WIDTH=128 HEIGHT=40>
            <P>Attack Pattern: <a href=help.php?game=$game&help=attack_pattern>HUH??</a></P>
         </TD>
         <TD HEIGHT=40>
            <P><TEXTAREA NAME=attack_pattern ROWS=7 COLS=27 WRAP=virtual>$findEnemy[attack_pattern]</TEXTAREA></P>
         </TD>
      </TR>
      <TR>
         <TD COLSPAN=2 HEIGHT=30 BGCOLOR="$topAndBottomBG">
            <CENTER><FONT SIZE="-1" COLOR="$topAndBottomText"><I><INPUT TYPE=submit NAME=Submit VALUE="Edit Enemy!!"></I></FONT></CENTER>
         </TD>
      </TR>
   </TABLE>
   </CENTER>
</FORM></P>

END;
}

print "$closeHTML";
?>
